package com.cy;

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

@Component
public class DefaultRequestOriginParser implements RequestOriginParser {

    /**
     * 构建请求参数解析对象,基于此对象的返回值进行授权访问设计
     * @param httpServletRequest
     * @return
     */

    @Override
    public String parseOrigin(HttpServletRequest httpServletRequest) {
        String originValue = httpServletRequest.getParameter("origin");
        return originValue;
    }
}
